#include<cstdio>
#include <algorithm>
#include <iostream>

using namespace std;
const int maxn = 100000 + 100;
typedef long long ll;
struct Node {
    int t, s;
} node[maxn * 2];
int vis[maxn];

bool cmp(Node a, Node b) {
    if (a.t != b.t) return a.t < b.t;
    else return a.s < b.s;
}

int main() {
    int n;
    while (cin>>n) {
        n = n * 2;
        for (int i = 0; i < n; i++) {
            cin>>node[i].t;
            if (i % 2 == 0) node[i].s = 1;
            else node[i].s = -1;
        }
        sort(node, node + n, cmp);
        int sum = 0, Max = 0;
        for (int i = 0; i < n; i++) {
            sum += node[i].s;
            Max = max(sum, Max);
        }
        cout<<Max<<endl;
    }

    return 0;
}